package com.example.demo.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.bean.StudentVO;
import com.example.demo.entity.Student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 自动
 * @since 2019-01-14
 */
public interface StudentMapper extends BaseMapper<Student> {

    @Select("select s.* , c.score from student s  join score c on  s.s_id = c.ids where s.s_id = #{id}")
    List<StudentVO> getStudentScore(@Param("id") String id);

    @Select("select s.*  from student s ")
    List<Student> getPage(Page<Student> page);
}
